package com.example.win.android_banduyujia.manager;


import android.os.Environment;

/**
 * Created by Win on 2015/8/18.
 */
public class FileManager {

    public static String getSaveFilePath()  {
        // return getRootFilePath() + Constants.P;
        return getRootFilePath();
    }

    public static String getDownloadFilePath() {
        return getRootFilePath();
    }

    public static String getRootFilePath(){
        if(hasSDCard()){
            return Environment.getExternalStorageDirectory().getPath();
        }else{
            return Environment.getDataDirectory().getAbsolutePath() + "/data";
        }
    }

    private static boolean hasSDCard() {
         String  status = Environment.getExternalStorageState();
         if(!status.equals(Environment.MEDIA_MOUNTED)){
             return false;
         }
        return true;
    }


}
